home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / ddx / sprite.X11R3 / hdr / memreg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-03  |  2.3 KB  |  65 lines

  1. /* @(#)memreg.h 1.16 88/02/08 SMI */
  2.  
  3. /*
  4.  * Copyright 1983, 1987 by Sun Microsystems, Inc.
  5.  */
  6.  
  7. #ifndef    memreg_DEFINED
  8. #define    memreg_DEFINED
  9.  
  10. /*
  11.  * Rasterop hardware registers.  To do a rasterop set the
  12.  * rasterop function in mrc_op.  Clear mrc_pattern unless
  13.  * a special pattern is desired.
  14.  *
  15.  * Set mrc_shift to cause the source to be properly
  16.  * aligned with the destination:  if words are being processed
  17.  * left-to-right, then mrc_shift should be a positive number
  18.  * between 0 and 15 inclusive; if words are being processed
  19.  * right-to-left, then mrc_shift should be a negative number
  20.  * between -16 and -1 inclusive.  If the first source word
  21.  * does not supply enough data to satisfy the first destination
  22.  * words requirements then load mrc_source1 (in the left-to-right
  23.  * case) or mcr_source2 (in the right-to-left case) with the
  24.  * first source word.
  25.  *
  26.  * Load mrc_mask1 with a mask of the bits not contributed by
  27.  * the first source word (if the width were large), i.e. a
  28.  * mask of high-order bits.  Load mrc_mask2 with a mask of the
  29.  * bits not contributed by the last source word, i.e. a mask
  30.  * of low-order bits.  Set mrc_width to the number of words
  31.  * in the destination line.
  32.  *
  33.  * Then enable the chip and stuff the data through it and
  34.  * finally disable the chip.
  35.  */
  36. struct memropc {
  37.     u_short    mrc_dest;        /* destination register */
  38.     u_short    mrc_source1;        /* source1 register (right) */
  39.     u_short    mrc_source2;        /* source2 register (left) */
  40.     u_short    mrc_pattern;        /* pattern register */
  41.     u_short    mrc_mask1;        /* mask1 register */
  42.     u_short mrc_mask2;        /* mask2 register */
  43.     short    mrc_shift;        /* bit 0..3 shift count for source */
  44.                     /* bit 8    sourceload bit */
  45.     short    mrc_op;            /* function */
  46.     short    mrc_width;        /* word width */
  47.     short    mrc_opcount;        /* counts down the width */
  48.     short    mrc_decoderout;        /* decoder output */
  49.     short    mrc_x11;        /* manual load destination (diag)*/
  50.     short    mrc_x12;        /* manual load source (diag) */
  51.     short    mrc_x13;
  52.     short    mrc_x14;
  53.     short    mrc_x15;        /* flags register for applications */
  54. };
  55.  
  56. /* note: these are not relevant to color boards */
  57. #define    mrc_enable(mrc)        ((mrc)->mrc_shift |= 0x100)
  58. #define    mrc_disable(mrc)    ((mrc)->mrc_shift &= ~0x100)
  59.  
  60. /* macros for generating left (mask1) and right (mask2) masks */
  61. #define    mrc_lmask(x)    (0xffff0000 >> (x))
  62. #define    mrc_rmask(x)    (0x7fff >> (x))
  63.  
  64. #endif    memreg_DEFINED
  65.